This project studied the effect of behavioral and environmental variables on responses of neurons in the medullary dorsal horn (trigeminal nucleus caudalis) to noxious and innocuous thermal stimuli. Rhesus monkeys were trained to detect the termination of innocuous heat stimuli and the onset of noxious heat stimuli. In a second task, the same monkeys detected the onset of a light stimulus. Neurons that responded to passive noxious mechanical and thermal stimulation also responded to other stimuli the monkey used for successful completion of a task. These task-related responses occurred to visual or thermal stimuli that predicted availability of reward. Neurons that reliably coded intensity of noxious thermal stimuli generally showed only small task-related responses, while neurons with large task-related responses often had imprecise sensory properties. Both types of neurons projected to the thalamus. These task-related responses may modulate sensory activity and thereby influence the perception of and response to oral-facial pain.